#ifndef _WK_SERVICE_H_H_
#define _WK_SERVICE_H_H_

#include "ble.h"
#include "ble_srv_common.h"

#include <stdint.h>
#include <stdbool.h>

#define M_SERVICE_CHAR_MAX_LEN              (20)

#define BASE_SERVICE_UUID      {{ 0xC7, 0x5D, 0x2A, 0x01, 0xE3, 0x65, 0x26, 0xAF, 0x47, 0x4E, 0x11, 0xD7, 0x28, 0xF7, 0x5B, 0xDE}}
#define M_DFU_SERVICE_UUID          0xf728
#define M_DFU_SERVICE_UUID_RX       0xf72a      //rx data from app
#define M_DFU_SERVICE_UUID_TX       0xf729      //notify data to app
typedef void (*m_dfu_rx_data_handler_t)(uint8_t *p_data, uint8_t len); 

typedef struct m_dfu_service_s
{
	uint8_t 				    uuid_type;	
    uint16_t                    conn_handle;
    uint16_t                    service_handle;
    ble_gatts_char_handles_t    rx_handle;
    ble_gatts_char_handles_t    tx_handle;
    bool                        is_notification_enable;
    m_dfu_rx_data_handler_t     rx_data_handler;
}m_dfus_t;


void m_dfu_service_init(m_dfu_rx_data_handler_t rx_data_handler);
void m_ble_on_ble_evt(ble_evt_t *p_ble_evt);
uint32_t m_dfu_sevice_send_string(uint8_t * string, uint16_t length);

#endif
